package bai5.model;

import java.util.Scanner;

public class Salary {
	private String name;
	private double bankAccount;
	private double grossWage;
	public Salary(){
		
	}
	public Salary(String name, double bankAccount, double grossWage) {
		super();
		this.name = name;
		this.bankAccount = bankAccount;
		this.grossWage = grossWage;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getBankAccount() {
		return bankAccount;
	}
	public void setBankAccount(int bankAccount) {
		this.bankAccount = bankAccount;
	}
	public double getGrossWage() {
		return grossWage;
	}
	public void setGrossWage(double grossWage) {
		this.grossWage = grossWage;
	}
	public Salary inputSalary(){
		Scanner sc=new Scanner(System.in);
		System.out.println("========Them moi Salary=========");
		System.out.println("Nhap ten:");
		String name=sc.nextLine();
		while(name.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap gia tri");
			name=sc.nextLine();
		}
		System.out.println("Nhap tai khoan:");
		double bankAccount=sc.nextDouble();
		System.out.println("Nhap tong luong");
		double grossWage=sc.nextDouble();
		Salary sl=new Salary(name,bankAccount,grossWage);
		return sl;
	}
	public void display(Salary sl){
		System.out.println("Ten vua nhap vao la: "+sl.name);
		System.out.println("Tai khoan vua nhap vao la: "+sl.bankAccount);
		System.out.println("Tong luong vua nhap vao la: "+sl.grossWage);
	}

}
